package md.action;

import md.constants.FieldType;
import md.draw.MapPainter;
import md.map.GameMap;
import md.objects.Enemy;
import md.objects.GameObjects;
import md.objects.Turrent;

public class GameController  {

	public final static void init() {
		GameMap.init();
		GameObjects.init();
	}
	
	public final static void calculateTurn() {
		GameObjects.currentWave.calculateTurn();
	}
	
	public final static void addTurrent(int x, int y) {
		GameObjects.addTurrent(new Turrent(x, y));
		GameMap.setValue(x, y, FieldType.TURRENT);
		MapPainter.needRefresh = true;
		GameMap.calculateDefaultPath();
	}
	
	public final static void activateEnemy(Enemy e) {
		e.alive = true;
		/*
		e.path = AIController.findPath(e.x, e.y, 
										GameMap.decodeX(GameMap.endPoint), 
										GameMap.decodeY(GameMap.endPoint));
		*/
		e.pathPosition = 0;
	}
}
